/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.suli.document.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import me.zhengjie.base.BaseEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;

/**
* @website https://eladmin.vip
* @description /
* @author Allen Gao
* @date 2022-12-30
**/
@Entity
@Data
@Table(name="tray")
public class Tray extends BaseEntity implements Serializable {

    @Id
    @Column(name = "`id`")
    @ApiModelProperty(value = "id")
    private String id;

    @Column(name = "`tray_code`")
    @ApiModelProperty(value = "托盘编码")
    private String trayCode;

    @Column(name = "`tray_name`")
    @ApiModelProperty(value = "托盘名称")
    private String trayName;

    @Column(name = "`tray_status`")
    @ApiModelProperty(value = "托盘状态")
    private Integer trayStatus;

    @Column(name = "`tray_type`")
    @ApiModelProperty(value = "托盘类型")
    private Integer trayType;

    @Column(name = "`road_way`")
    @ApiModelProperty(value = "所属巷道")
    private Integer roadWay;

    @Column(name = "`remark`")
    @ApiModelProperty(value = "备注")
    private String remark;

    @Column(name = "`create_by`")
    @ApiModelProperty(value = "创建人")
    private String createBy;

    @Column(name = "`update_by`")
    @ApiModelProperty(value = "修改人")
    private String updateBy;

    @Column(name = "`create_time`")
    @ApiModelProperty(value = "创建日期")
    private Timestamp createTime;

    @Column(name = "`update_time`")
    @ApiModelProperty(value = "修改时间")
    private Timestamp updateTime;

    @Column(name = "`location_code`")
    @ApiModelProperty(value = "所属库位")
    private String locationCode;

    @Column(name = "`is_full`")
    @ApiModelProperty(value="是否有货")
    private BigDecimal isFull;


    public void copy(Tray source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
